<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>练习</title>
</head>
<body>
<script>
    function myRandom(min, max) {
        // TODO 生成 [min,max]的随机数,包含min和max的值
        return parseInt(min + (Math.random() * (max - min + 1)));
    }

    function randomOneDate() {
        // TODO 随机一个年月日  在2010-1-1 与2020-12-31之间

        return new Date(
            myRandom(
                new Date(2010, 1 - 1, 1).getTime(),
                new Date(2020, 12 - 1, 31).getTime()
            )
        );
    }

    document.write(randomOneDate());
</script>
<br>
<div id="div-01">Here is div-01</div>
<div id="div-02">Here is div-02</div>
<div id="div-03">Here is div-03</div>
<br>
<input type="button" value="删除div-02" onclick="delDiv02()">
<script>
    function delDiv02() {
        var el = document.getElementById('div-02');
        el.remove();
        // Removes the div with the 'div-02' id

    }

</script>
</body>
</html>